import request from '@/utils/request'

// 查询充电记录列表
export function listYunyingrecord(query) {
  return request({
    url: '/system/yunyingrecord/list',
    method: 'get',
    params: query
  })
}

// 查询充电记录详细
export function getYunyingrecord(recordId) {
  return request({
    url: '/system/yunyingrecord/' + recordId,
    method: 'get'
  })
}

// 新增充电记录
export function addYunyingrecord(data) {
  return request({
    url: '/system/yunyingrecord',
    method: 'post',
    data: data
  })
}
export function getChartData() {
  return request({
    url: '/system/yunyingrecord/chartData',
    method: 'get',
  })
}

export function selectalls(scharging_date) {
  return request({
    url: '/system/yunyingrecord/finds',
    method: 'get',
    params: {scharging_date}  // 包含charging_date参数
  })
}

export function selecttotal() {
  return request({
    url: '/system/yunyingrecord/findtotal',
    method: 'get',

  })
}


// 修改充电记录
export function updateYunyingrecord(data) {
  return request({
    url: '/system/yunyingrecord',
    method: 'put',
    data: data
  })
}

// 删除充电记录
export function delYunyingrecord(recordId) {
  return request({
    url: '/system/yunyingrecord/' + recordId,
    method: 'delete'
  })
}
